home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Applications / Alpha.5.96 folder / Tcl / SystemCode / browser.tcl < prev    next >
Encoding:
Text File  |  1994-07-08  |  684 b   |  28 lines  |  [TEXT/ALFA]

  1. #=============================================================================
  2. # Browser mode.
  3. #=============================================================================
  4. proc dummyBrws {} {}
  5.  
  6. proc upBrowse {} {
  7.     set limit [nextLineStart [nextLineStart 0]]
  8.     if {[getPos] > $limit} {
  9.         set limit [expr [getPos] - 1]
  10.     }
  11.     select [lineStart $limit] [nextLineStart $limit]
  12. }
  13.  
  14. proc downBrowse {} {
  15.     if {[nextLineStart [getPos]] != [maxPos]} {
  16.         select [nextLineStart [getPos]] [nextLineStart [nextLineStart [getPos]]]
  17.     }
  18. }
  19.  
  20. bind '\r'        gotoMatch    Brws
  21. bind enter        gotoMatch    Brws
  22. bind down         downBrowse Brws
  23. bind up         upBrowse Brws
  24. bind 'n' <z>    downBrowse Brws
  25. bind 'p' <z>    upBrowse Brws
  26.  
  27.  
  28.